<?php

namespace app\model\office;

use app\model\BaseModel;
use think\model\concern\SoftDelete;

class OfficeStudyRecord extends BaseModel
{
    use SoftDelete;

    /**
     * 数据表主键
     * @var string
     */
    protected $pk = 'id';

    /**
     * 模型名称
     * @var string
     */
    protected $table = 'free_office_video_record';
    protected $deleteTime = 'delete_time';
    protected $defaultSoftDelete = '0000-00-00 00:00:00';

    // 设置字段信息
    protected $type = [
        'is_pass' => 'boolean',
    ];

    public function users(){
        return $this->hasOne(OfficeUser::class,'id','user_id');
    }

    public function officeClass(){
        return $this->hasOne(OfficeClass::class,'id','class_id');
    }

    public function chapter(){
        return $this->hasOne(OfficeChapter::class,'id','chapter_id');
    }
}